package lab.gene.action;

import java.util.List;

import lab.gene.pojo.Gene;
import lab.gene.pojo.PrimerSequence;
import lab.gene.service.impl.GeneServiceImpl;
import lab.gene.service.impl.PrimerSequenceServiceImpl;

import com.opensymphony.xwork2.ActionSupport;

public class GeneDetailsAction extends ActionSupport  {
	
	private static final long serialVersionUID = 1L;
	private String geneName = null;
	private Gene gene = null;
	private String comment = null;
	private List<PrimerSequence> primerSeqList = null;

	public String execute() {
		System.out.println("Gene Details Action!");
		GeneServiceImpl geneService = new GeneServiceImpl();
		gene = geneService.getGene(geneName);
		comment = geneService.getGeneComments(geneName);
		PrimerSequenceServiceImpl primerService = new PrimerSequenceServiceImpl();
		primerSeqList = primerService.getAllPrimerSequencesByGeneName(geneName);
		return "success";
	}

	public String getGeneName() {
		return geneName;
	}

	public void setGeneName(String geneName) {
		this.geneName = geneName;
	}

	public Gene getGene() {
		return gene;
	}

	public void setGene(Gene gene) {
		this.gene = gene;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public List<PrimerSequence> getPrimerSeqList() {
		return primerSeqList;
	}

	public void setPrimerSeqList(List<PrimerSequence> primerSeqList) {
		this.primerSeqList = primerSeqList;
	}

}
